<template>
	<view class="history">
		<image src="../../static/images/history.jpg" mode="aspectFill"></image>
		<topic v-for="topic in topics" :topic="topic" :key="topic.id"/>
	</view>
</template>

<script>
import { STUDY_HISTORY } from '../../utils';
	export default {
		data() {
			return {
				topics:[]
			};
		},
		async onShow(){
			let studyHistory = uni.getStorageSync(STUDY_HISTORY)||[];
			this.topics=studyHistory;
		}
	}
</script>

<style lang="scss">
.history{
	image{
		width:100%;
		height:300rpx;
		border-radius: 20rpx;
	}
}
</style>
